<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:sec="http://www.springframework.org/security/facelets/tags">
<h:body>

	<h:form>
		<p:toolbar styleClass="menu">
			<p:toolbarGroup>
				<p:commandButton value="Administração do Sistema" type="button"
					id="menu1" />
				<p:menu position="dynamic" trigger="menu1" my="left top"
					at="left bottom">
					<p:menuitem value="Clínica" url="/sistema/sysadmin/empresa.xhtml" />
					<!-- <p:menuitem value="Convênio" url="/sistema/sysadmin/convenio.xhtml" /> -->
				</p:menu>
			</p:toolbarGroup>

			<p:toolbarGroup>
				<p:commandButton value="Administração da Clínica" type="button"
					id="menu2" />
				<p:menu position="dynamic" trigger="menu2" my="left top"
					at="left bottom">
					<p:menuitem value="Funcionario"
						url="/sistema/admin/funcionario.xhtml" />
					<p:menuitem value="Convênios da Clínica"
						url="/sistema/admin/convenioEmpresa.xhtml" />
					<p:menuitem value="Bloqueio Geral de Horários"
						url="/sistema/admin/bloqueioHorario.xhtml" />
				</p:menu>
			</p:toolbarGroup>


			<p:toolbarGroup>
				<p:commandButton value="Configurações" type="button" id="menu5" />
				<p:menu position="dynamic" trigger="menu5" my="left top"
					at="left bottom">
					<p:menuitem value="Meus Dados"
						url="/sistema/usuario/usuario.xhtml" />
				</p:menu>
			</p:toolbarGroup>

			<p:toolbarGroup align="right">
				<sec:isAnonymous>
					<p:button value="Entrar" icon="ui-icon-locked"
						href="#{facesContext.externalContext.requestContextPath}/sistema/login.xhtml" />
				</sec:isAnonymous>
				<sec:isAuthenticated>
					<p:button value="Sair" icon="ui-icon-power"
						href="#{facesContext.externalContext.requestContextPath}/j_spring_security_logout" />
				</sec:isAuthenticated>
			</p:toolbarGroup>
		</p:toolbar>
	</h:form>
</h:body>
</html>
